def load_list(filepath):
    """加载域名或关键词列表"""
    with open(filepath, 'r', encoding='utf-8') as f:
        return [line.strip() for line in f if line.strip()]


def generate_urls(middles, tlds, protocol='http'):
    """生成所有可能的URL组合"""
    urls = []
    for middle in middles:
        for tld in tlds:
            # 动态拼接域名格式：middle.tld
            domain = f"{middle}.{tld}"
            url = f"{protocol}://{domain}"
            urls.append(url)
    return urls

